﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJ.Business;
using System.Collections.ObjectModel;
using System.Collections;

namespace PJ.Presentation
{
    /// <summary>
    /// Model for <see cref="IBusinessObject"/> lists
    /// </summary>
    /// <typeparam name="TIBusinessObject">List item object type</typeparam>
    public interface IBusinessObjectListViewModel : IViewModel
    {
        /// <summary>
        /// Set a new list
        /// </summary>
        /// <param name="globalIdList">list of new object global ids</param>
        void SetValues (string[] globalIdList);

        /// <summary>
        /// Get the model list content
        /// </summary>
        /// <returns>List of object global ids</returns>
        IEnumerable<string> GetValues();

        /// <summary>
        /// List of items in the list
        /// </summary>
        IList Items { get; set; }

        /// <summary>
        /// Method to persist modified data
        /// </summary>
        void Persist();

        /// <summary>
        /// Method to handle item selection change
        /// </summary>
        /// <param name="itemModel">new selected item</param>
        void SelectionChange(IBusinessObjectModel itemModel);

        /// <summary>
        /// Initialize new item event handler
        /// </summary>
        /// <param name="newItem">New item to initialize</param>
        void InitializingNewItem(IBusinessObjectModel newItem);

    }
}
